const keepAliveStore = defineStore(
  'keepAlive',
  {
    state: () => ({
      keepAliveList: []
    }),
    actions: {
      pushKeepaliveList(data){
        if (data && !this.keepAliveList.some((item) => item === data)) {
            this.keepAliveList.push(data)
        }
      },
      closeKeepaliveList(data){
        this.keepAliveList = this.keepAliveList.filter(item => item !== data.name)
      },
        clearKeepaliveList() {
            this.keepAliveList = []
        }
    }  
  })

export default keepAliveStore
